import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:demo/views/friend/friend_details_view.dart';
import 'package:demo/views/friend/friend_index_controller.dart';
import 'package:demo/component/component_contact.dart';

// 好友列表
class FriendIndexView extends GetView<FriendIndexController> {
  const FriendIndexView({super.key});

  @override
  Widget build(BuildContext context) {
    Get.lazyPut(() => FriendIndexController());
    return GetBuilder<FriendIndexController>(builder: (builder) {
      return Scaffold(
        resizeToAvoidBottomInset: false,
        appBar: AppBar(
          title: const Text('好友'),
        ),
        body: ComponentContact(
          dataList: builder.dataList,
          onTap: (ContactModel value) {
            Get.toNamed(
              FriendDetailsView.routeName,
              arguments: value.userId,
            );
          },
        ),
      );
    });
  }
}
